import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

export default new Router({
  mode: "history",
  base: process.env.BASE_URL,
  routes: [
    {
      path: "/",
      name: "home",
      redirect: "central",
      component: resolve => require(['@/views/Home.vue'], resolve),
      children: [
        { path: "central", name: "central", component: resolve => require(['@/views/tabbar/Central.vue'], resolve) },
        { path: "member", name: "member", component: resolve => require(['@/views/tabbar/Member.vue'], resolve) },
        { path: "shoppingCart", name: "shoppingCart", component: resolve => require(['@/views/tabbar/ShoppingCart.vue'], resolve) },
        { path: "search", name: "search", component: resolve => require(['@/views/tabbar/Search.vue'], resolve) },
        { path: "newsList", name: "newsList", component: resolve => require(['@/views/news/NewsList.vue'], resolve) },
        { path: "newsDetail", name: "newsDetail", component: resolve => require(['@/views/news/NewsDetail.vue'], resolve) },
        { path: "photo", name: "photo", component: resolve => require(['@/views/photo/Photo.vue'], resolve) },
        { path: "photoInfo", name: "photoInfo", component: resolve => require(['@/views/photo/PhotoInfo.vue'], resolve) },
        { path: "commodity", name: "commodity", component: resolve => require(['@/views/commodity/Commodity.vue'], resolve) },
        { path: "commodityInfo", name: "commodityInfo", component: resolve => require(['@/views/commodity/CommodityInfo.vue'], resolve) },
        { path: "introduce", name: "introduce", component: resolve => require(['@/views/commodity/Introduce.vue'], resolve) },
        { path: "goodsComment", name: "goodsComment", component: resolve => require(['@/views/commodity/GoodsComment.vue'], resolve) },
        { path: "message", name: "message", component: resolve => require(['@/views/message/Message.vue'], resolve) },
        { path: "videoZone", name: "videoZone", component: resolve => require(['@/views/videoZone/VideoZone.vue'], resolve) },
        { path: "contact", name: "contact", component: resolve => require(['@/views/contact/Contact.vue'], resolve) },
      ]
    }
  ]
});
